<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.*,com.carsite.webapp.help.BranchDeptHelp"%>          
<div style="display:none;visibility:hidden;position:absolute; left:window.event.x; top:window.event.y;  background-color:#FFFFFF;  width:200px; z-index:1;" id="branchDiv" >

<table border="1" bgcolor="#FFFFCC"  width="200" id="table2" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="0">
  <tr  align='center' valign="middle">
    <td align="left">
	   <link type="text/css" rel="stylesheet" href="tree/xtree.css">
	   <script src="tree/xtree.js"></script>
	   <script language="javascript" type="text/javascript">
		    var divId ="";
			var elementObj;
			var idOjb;
			function onShow(srcelement,idOjbName,id){
			   elementObj=srcelement;
			   divId=id;
			   idOjb = document.getElementById(idOjbName);
			   document.getElementById(divId).style.visibility="visible";
			   document.getElementById(divId).style.display="";
			   document.getElementById(divId).style.left=window.event.x-10;
			   document.getElementById(divId).style.top=window.event.y+6;
			}
			function onSel(parentId,type){
			    if(parentId==0){
			        idOjb.value="";
			        elementObj.value ="";
			    }else{
			       elementObj.value =rootTree.getSelected().text;
			       idOjb.value=parentId;
			    }
			    document.getElementById(divId).style.visibility="hidden";
			    document.getElementById(divId).style.display="none";
			  
			}
		    
		   
             <%
                String isParent= request.getParameter("isParent");
                String  tree=BranchDeptHelp.dumpBranchScript((List)request.getAttribute("branchList"),isParent,"true");
                 out.println(tree);
               %>
			  document.write(rootTree);
						 
						 
		</script>
		
		
   </td>
  </tr>
</table>


</div>